#!/usr/local/bin/perl
#
# Copyright 1993 University of Minnesota
#
# A simple Perl script that makes up part of a gopher+
# conferencing system/method that allows users to
# dynamically grow a section of gopherspace. This is
# done by taking advantage of gopher+ ask blocks.
#
# this section allows users to add to the dynamic document
# called the CB radio
#
#       Mark P. McCahill
#       March 1993


$IFileName = <>;
$no_of_lines = <>;

# Make unsecure fields secure
$IFileName =~ m/^(.*)$/;
$FileName = $1;

# check to see if a file exists with same name
if ( -e $FileName ) { 
  print "File name exists, Please choose another ";
  exit(1);
  };

#  Now eat the rest of the ASK long block
#  and dump it into the file
open( thefile, ">$FileName");
print thefile <>;
close( thefile );

#return something to the user
print "Your comments have been added\n";

# nuke the .cache file
unlink ".cache";
unlink ".cache+";
